<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Client</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Class: Client</h1>
<section>
<header>
    <h2>
        <span class="ancestors"><a href="Messaging.html">Messaging</a>.</span>
        Client
    </h2>
</header>
<article>
<div class="container-overview">


<dt>
<h4 class="name" id="Client"><span class="type-signature"></span>new Client<span class="signature">(host, port, clientId)</span><span
        class="type-signature"></span></h4>


</dt>
<dd>


<div class="description">
    The JavaScript application communicates to the server using a
    Messaging.Client object.
    <p>
        Other programming languages, <big>Java</big>,<big>C</big>.

    <p>
        Most applications will create just one Client object and then call its
        connect() method, however applications can create more than one Client
        object if they wish. In this case the combination of host, port and
        clientId attributes must be different for each Client object.

    <p>
        The send, subscribe and unsubscribe methods are implemented as
        asynchronous JavaScript methods (even though the underlying protocol
        exchange might be synchronous in nature). This means they signal their
        completion by calling back to the application, via Success or Failure
        callback functions provided by the application on the method in question.
        Such callbacks are called at most once per method invocation and do not
        persist beyond the lifetime of the script that made the invocation.

    <p>
        In contrast there are some callback functions most notably<i>
        <b>onMessageArrived</b>,<b>trace</b></i> that are defined on the Messaging.Client object.
        These may get called multiple times, and aren't directly related to
        specific method invocations made by the client.

        Creates a Messaging.Client object that can be used to communicate with a Messaging server.
</div>


<h5>Parameters:</h5>


<table class="params">
    <thead>
    <tr>
        <th>Name</th>
        <th>Type</th>
        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    <tr>
        <td class="name"><code>host</code></td>
        <td class="type">
            <span class="param-type">string</span>
        </td>
        <td class="description last">The address of the messaging server, as a DNS name or
            dotted decimal IP address.
        </td>
    </tr>
    <tr>
        <td class="name"><code>port</code></td>
        <td class="type">
            <span class="param-type">number</span>
        </td>
        <td class="description last">The port number in the host to connect to.</td>
    </tr>
    <tr>
        <td class="name"><code>clientId</code></td>
        <td class="type">
            <span class="param-type">string</span>
        </td>
        <td class="description last">The Messaging client identifier, between 1 and 23
            characters in length.
        </td>
    </tr>


    </tbody>
</table>


<dl class="details">


<h5 class="subsection-title">Properties:</h5>

<dl>

    <table class="props">
        <thead>
        <tr>

            <th>Name</th>


            <th>Type</th>


            <th class="last">Description</th>
        </tr>
        </thead>

        <tbody>


        <tr>

            <td class="name"><code>host</code></td>


            <td class="type">


                <span class="param-type">string</span>


            </td>


            <td class="description last"><i>read only</i> The server's DNS hostname or
                dotted decimal IP address.
            </td>
        </tr>


        <tr>

            <td class="name"><code>port</code></td>


            <td class="type">


                <span class="param-type">number</span>


            </td>


            <td class="description last"><i>read only</i> The server's port.</td>
        </tr>


        <tr>

            <td class="name"><code>clientId</code></td>


            <td class="type">


                <span class="param-type">string</span>


            </td>


            <td class="description last"><i>read only</i> used when connecting to the
                server.
            </td>
        </tr>


        <tr>

            <td class="name"><code>onConnectionLost</code></td>


            <td class="type">


                <span class="param-type">function</span>


            </td>


            <td class="description last">called when a connection has been
                lost, after a connect() method has succeeded. Establish the
                call back used when a connection has been lost. The connection
                may be lost because the client initiates a disconnect or
                because the server or network cause the client to be
                disconnected. The disconnect call back may be called without
                the connectionComplete call back being invoked if, for example
                the client fails to connect. A single response object parameter
                is passed to the onConnectionLost callback containing the
                following fields:
                <ol>
                    <li>errorCode
                    <li>errorMessage
                </ol>
            </td>
        </tr>


        <tr>

            <td class="name"><code>onMessageDelivered</code></td>


            <td class="type">


                <span class="param-type">function</span>


            </td>


            <td class="description last">called when a message has been
                delivered. All processing that this Client will ever do has
                been completed. So, for example, in the case of a Qos=2 message
                sent by this client, the PubComp flow has been received from
                the server and the message has been removed from persistent
                storage before this callback is invoked. Parameters passed to
                the onMessageDelivered callback are:
                <ol>
                    <li>Messaging.Message that was delivered.
                </ol>
            </td>
        </tr>


        <tr>

            <td class="name"><code>onMessageArrived</code></td>


            <td class="type">


                <span class="param-type">function</span>


            </td>


            <td class="description last">called when a message has arrived
                in this Messaging.client. Parameters passed to the
                onMessageArrived callback are:
                <ol>
                    <li>Messaging.Message that has arrived.
                </ol>
            </td>
        </tr>


        <tr>

            <td class="name"><code>trace</code></td>


            <td class="type">


                <span class="param-type">function</span>


            </td>


            <td class="description last">called when Android service, Cordova plugin
                or this client library generate trace msessage. Parameters passed to the
                trace callback is object:
                <ol>
                    <li>severity
                    <li>message
                </ol>
            </td>
        </tr>


        </tbody>
    </table>
</dl>


<dt class="tag-source">Source:</dt>
<dd class="tag-source">
    <ul class="dummy">
        <li>
            <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a href="mqttCordovaClient.js.html#line844">line
            844</a>
        </li>
    </ul>
</dd>


</dl>


</dd>


</div>


<h3 class="subsection-title">Methods</h3>

<dl>

<dt>
<h4 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(<span
        class="optional">connectOptions</span>)</span><span class="type-signature"></span></h4>


</dt>
<dd>


<div class="description">
    Connect this Messaging client to its server.
</div>


<h5>Parameters:</h5>


<table class="params">
<thead>
<tr>

    <th>Name</th>


    <th>Type</th>


    <th>Argument</th>


    <th class="last">Description</th>
</tr>
</thead>

<tbody>


<tr>

<td class="name"><code>connectOptions</code></td>


<td class="type">


    <span class="param-type">Object</span>


</td>


<td class="attributes">

    &lt;optional><br>


</td>


<td class="description last">attributes used with the connection.
<h6>Properties</h6>


<table class="params">
<thead>
<tr>

    <th>Name</th>


    <th>Type</th>


    <th>Argument</th>


    <th class="last">Description</th>
</tr>
</thead>

<tbody>


<tr>

    <td class="name"><code>timeout</code></td>


    <td class="type">


        <span class="param-type">number</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">If the connect has not succeeded within
        this number of seconds, it is deemed to have failed. The
        default is 30 seconds. <br>It is also used as global timeout,
        If set Failure callback in subscribe or unsubscribe.
    </td>
</tr>


<tr>

    <td class="name"><code>userName</code></td>


    <td class="type">


        <span class="param-type">string</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">Authentication username for this connection.</td>
</tr>


<tr>

    <td class="name"><code>password</code></td>


    <td class="type">


        <span class="param-type">string</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">Authentication password for this connection.</td>
</tr>


<tr>

    <td class="name"><code>willMessage</code></td>


    <td class="type">


        <span class="param-type"><a href="Messaging.Message.html">Messaging.Message</a></span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">sent by the server when the
        client disconnects abnormally.
    </td>
</tr>


<tr>

    <td class="name"><code>keepAliveInterval</code></td>


    <td class="type">


        <span class="param-type">Number</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">the server disconnects this
        client if there is no activity for this number of seconds.
        The default value of 60 seconds is assumed if not set.
    </td>
</tr>


<tr>

    <td class="name"><code>cleanSession</code></td>


    <td class="type">


        <span class="param-type">boolean</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">if true(default) the client and
        server persistent state is deleted on successful connect.
    </td>
</tr>


<tr>

    <td class="name"><code>useSSL</code></td>


    <td class="type">


        <span class="param-type">boolean</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">if present and true, use an SSL connection.</td>
</tr>


<tr>

    <td class="name"><code>sslProperties</code></td>


    <td class="type">


        <span class="param-type">object</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">SSL properties for the SSL connection.
        <br>It contains the following fields:
        <ol>
            <li>keyStorePath: a string indicate the path of key store file.
            <li>keyStorePassword : key store password.
        </ol>
    </td>
</tr>


<tr>

    <td class="name"><code>invocationContext</code></td>


    <td class="type">


        <span class="param-type">object</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">passed to the onSuccess callback
        or onFailure callback.
    </td>
</tr>


<tr>

    <td class="name"><code>onSuccess</code></td>


    <td class="type">


        <span class="param-type">function</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">called when the connect
        acknowledgement has been received from the server. A single
        response object parameter is passed to the onSuccess callback
        containing the following fields:
        <ol>
            <li>invocationContext as passed in to the onSuccess method
                in the connectOptions.
        </ol>
    </td>
</tr>


<tr>

    <td class="name"><code>onFailure</code></td>


    <td class="type">


        <span class="param-type">function</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">called when the connect request has
        failed or timed out. A single response object parameter is
        passed to the onFailure callback containing the following
        fields:
        <ol>
            <li>invocationContext as passed in to the onFailure method
                in the connectOptions.
            <li>errorCode a number indicating the nature of the error.
            <li>errorMessage text describing the error.
        </ol>
    </td>
</tr>


</tbody>
</table>
</td>
</tr>


</tbody>
</table>


<dl class="details">


    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
        <ul class="dummy">
            <li>
                <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                    href="mqttCordovaClient.js.html#line992">line 992</a>
            </li>
        </ul>
    </dd>


</dl>


<h5>Throws:</h5>


<dl>
    <dt>
    <div class="param-desc">
        if the client is not in disconnected state and not set Failure callback.
        The client must have received connectionLost or disconnected before
        calling connect for a second or subsequent time.
    </div>
    </dt>
    <dt>
    <dl>
        <dt>
            Type
        </dt>
        <dd>

            <span class="param-type">InvalidState</span>


        </dd>
    </dl>
    </dt>
</dl>


</dd>


<dt>
<h4 class="name" id="disconnect"><span class="type-signature"></span>disconnect<span class="signature">(<span
        class="optional">disconnectOptions</span>)</span><span class="type-signature"></span></h4>


</dt>
<dd>


    <div class="description">
        Normal disconnect of this Messaging client from its server.
    </div>


    <h5>Parameters:</h5>


    <table class="params">
        <thead>
        <tr>

            <th>Name</th>


            <th>Type</th>


            <th>Argument</th>


            <th class="last">Description</th>
        </tr>
        </thead>

        <tbody>


        <tr>

            <td class="name"><code>disconnectOptions</code></td>


            <td class="type">


                <span class="param-type">object</span>


            </td>


            <td class="attributes">

                &lt;optional><br>


            </td>


            <td class="description last">used with the operation, as follows:
                <h6>Properties</h6>


                <table class="params">
                    <thead>
                    <tr>

                        <th>Name</th>


                        <th>Type</th>


                        <th>Argument</th>


                        <th class="last">Description</th>
                    </tr>
                    </thead>

                    <tbody>


                    <tr>

                        <td class="name"><code>invocationContext</code></td>


                        <td class="type">


                            <span class="param-type">object</span>


                        </td>


                        <td class="attributes">

                            &lt;optional><br>


                        </td>


                        <td class="description last">passed to the onSuccess callback
                            or onFailure callback.
                        </td>
                    </tr>


                    <tr>

                        <td class="name"><code>onSuccess</code></td>


                        <td class="type">


                            <span class="param-type">function</span>


                        </td>


                        <td class="attributes">

                            &lt;optional><br>


                        </td>


                        <td class="description last">called when the operation has been
                            performed by the client
                        </td>
                    </tr>


                    <tr>

                        <td class="name"><code>onFailure</code></td>


                        <td class="type">


                            <span class="param-type">function</span>


                        </td>


                        <td class="attributes">

                            &lt;optional><br>


                        </td>


                        <td class="description last">called when the operation has failed
                            or timed out.
                        </td>
                    </tr>


                    </tbody>
                </table>
            </td>
        </tr>


        </tbody>
    </table>


    <dl class="details">


        <dt class="tag-source">Source:</dt>
        <dd class="tag-source">
            <ul class="dummy">
                <li>
                    <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                        href="mqttCordovaClient.js.html#line1278">line 1278</a>
                </li>
            </ul>
        </dd>


    </dl>


</dd>


<dt>
<h4 class="name" id="getTraceLog"><span class="type-signature"></span>getTraceLog<span class="signature">()</span><span
        class="type-signature"> &rarr; {Object[]}</span></h4>


</dt>
<dd>


    <div class="description">
        Get the contents of the trace log.
    </div>


    <dl class="details">


        <dt class="tag-source">Source:</dt>
        <dd class="tag-source">
            <ul class="dummy">
                <li>
                    <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                        href="mqttCordovaClient.js.html#line1302">line 1302</a>
                </li>
            </ul>
        </dd>


    </dl>


    <h5>Returns:</h5>


    <div class="param-desc">
        tracebuffer containing the time ordered trace
        records.
    </div>


    <dl>
        <dt>
            Type
        </dt>
        <dd>

            <span class="param-type">Object[]</span>


        </dd>
    </dl>


</dd>


<dt>
<h4 class="name" id="send"><span class="type-signature"></span>send<span class="signature">(<span class="optional">sendOptions</span>)</span><span
        class="type-signature"></span></h4>


</dt>
<dd>


<div class="description">
    Send a message to the consumers of the destination in the Message.
</div>


<h5>Parameters:</h5>


<table class="params">
    <thead>
    <tr>

        <th>Name</th>


        <th>Type</th>


        <th>Argument</th>


        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>


    <tr>

        <td class="name"><code>sendOptions</code></td>


        <td class="type">


            <span class="param-type">object</span>


        </td>


        <td class="attributes">

            &lt;optional><br>


        </td>


        <td class="description last">used with the operation, as follows:
            <p>
            <h6>Properties</h6>


            <table class="params">
                <thead>
                <tr>

                    <th>Name</th>


                    <th>Type</th>


                    <th>Argument</th>


                    <th class="last">Description</th>
                </tr>
                </thead>

                <tbody>


                <tr>

                    <td class="name"><code>invocationContext</code></td>


                    <td class="type">


                        <span class="param-type">object</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">passed to the onSuccess callback
                        or onFailure callback.
                    </td>
                </tr>


                <tr>

                    <td class="name"><code>onSuccess</code></td>


                    <td class="type">


                        <span class="param-type">function</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">called when the send has been
                        performed by the client (NB at this stage the message has not
                        necessarily been received by the server).
                    </td>
                </tr>


                <tr>

                    <td class="name"><code>onFailure</code></td>


                    <td class="type">


                        <span class="param-type">function</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">called when the send has failed or
                        timed out.
                    </td>
                </tr>


                </tbody>
            </table>
        </td>
    </tr>


    </tbody>
</table>


<dl class="details">


    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
        <ul class="dummy">
            <li>
                <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                    href="mqttCordovaClient.js.html#line1242">line 1242</a>
            </li>
        </ul>
    </dd>


</dl>


<h5>Throws:</h5>


<dl>
    <dt>
    <div class="param-desc">
        if the client is not in connected state and not set Failure callback.
    </div>
    </dt>
    <dt>
    <dl>
        <dt>
            Type
        </dt>
        <dd>

            <span class="param-type">InvalidState</span>


        </dd>
    </dl>
    </dt>
</dl>


</dd>


<dt>
<h4 class="name" id="startTrace"><span class="type-signature"></span>startTrace<span class="signature">()</span><span
        class="type-signature"></span></h4>


</dt>
<dd>


    <div class="description">
        Start tracing.
    </div>


    <dl class="details">


        <dt class="tag-source">Source:</dt>
        <dd class="tag-source">
            <ul class="dummy">
                <li>
                    <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                        href="mqttCordovaClient.js.html#line1314">line 1314</a>
                </li>
            </ul>
        </dd>


    </dl>


</dd>


<dt>
<h4 class="name" id="stopTrace"><span class="type-signature"></span>stopTrace<span class="signature">()</span><span
        class="type-signature"></span></h4>


</dt>
<dd>


    <div class="description">
        Stop tracing.
    </div>


    <dl class="details">


        <dt class="tag-source">Source:</dt>
        <dd class="tag-source">
            <ul class="dummy">
                <li>
                    <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                        href="mqttCordovaClient.js.html#line1324">line 1324</a>
                </li>
            </ul>
        </dd>


    </dl>


</dd>


<dt>
<h4 class="name" id="subscribe"><span class="type-signature"></span>subscribe<span class="signature">(filter, <span
        class="optional">subscribeOptions</span>)</span><span class="type-signature"></span></h4>


</dt>
<dd>


<div class="description">
    Subscribe for messages, request receipt of a copy of messages sent to
    the destinations described by the filter.
</div>


<h5>Parameters:</h5>


<table class="params">
<thead>
<tr>

    <th>Name</th>


    <th>Type</th>


    <th>Argument</th>


    <th class="last">Description</th>
</tr>
</thead>

<tbody>


<tr>

    <td class="name"><code>filter</code></td>


    <td class="type">


        <span class="param-type">string</span>


    </td>


    <td class="attributes">


    </td>


    <td class="description last">describing the destinations to receive messages
        from. <br></td>
</tr>


<tr>

    <td class="name"><code>subscribeOptions</code></td>


    <td class="type">


        <span class="param-type">object</span>


    </td>


    <td class="attributes">

        &lt;optional><br>


    </td>


    <td class="description last">used to control the subscription, as
        follows:
        <p>
        <h6>Properties</h6>


        <table class="params">
            <thead>
            <tr>

                <th>Name</th>


                <th>Type</th>


                <th>Argument</th>


                <th class="last">Description</th>
            </tr>
            </thead>

            <tbody>


            <tr>

                <td class="name"><code>qos</code></td>


                <td class="type">


                    <span class="param-type">number</span>


                </td>


                <td class="attributes">

                    &lt;optional><br>


                </td>


                <td class="description last">the maiximum qos of any publications sent as a
                    result of making this subscription.
                </td>
            </tr>


            <tr>

                <td class="name"><code>invocationContext</code></td>


                <td class="type">


                    <span class="param-type">object</span>


                </td>


                <td class="attributes">

                    &lt;optional><br>


                </td>


                <td class="description last">passed to the onSuccess callback
                    or onFailure callback.
                </td>
            </tr>


            <tr>

                <td class="name"><code>onSuccess</code></td>


                <td class="type">


                    <span class="param-type">function</span>


                </td>


                <td class="attributes">

                    &lt;optional><br>


                </td>


                <td class="description last">called when the subscribe
                    acknowledgement has been received from the server. A single
                    response object parameter is passed to the onSuccess callback
                    containing the following fields:
                    <ol>
                        <li>invocationContext if set in the subscribeOptions.
                    </ol>
                </td>
            </tr>


            <tr>

                <td class="name"><code>onFailure</code></td>


                <td class="type">


                    <span class="param-type">function</span>


                </td>


                <td class="attributes">

                    &lt;optional><br>


                </td>


                <td class="description last">called when the subscribe request has
                    failed or timed out. A single response object parameter is
                    passed to the onFailure callback containing the following
                    fields:
                    <ol>
                        <li>invocationContext if set in the subscribeOptions.
                        <li>errorCode a number indicating the nature of the error.
                        <li>errorMessage text describing the error.
                    </ol>
                </td>
            </tr>


            </tbody>
        </table>
    </td>
</tr>


</tbody>
</table>


<dl class="details">


    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
        <ul class="dummy">
            <li>
                <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                    href="mqttCordovaClient.js.html#line1135">line 1135</a>
            </li>
        </ul>
    </dd>


</dl>


<h5>Throws:</h5>


<dl>
    <dt>
    <div class="param-desc">
        if the client is not in connected state and not set Failure callback.
    </div>
    </dt>
    <dt>
    <dl>
        <dt>
            Type
        </dt>
        <dd>

            <span class="param-type">InvalidState</span>


        </dd>
    </dl>
    </dt>
</dl>


</dd>


<dt>
<h4 class="name" id="unsubscribe"><span class="type-signature"></span>unsubscribe<span class="signature">(filter, <span
        class="optional">unsubscribeOptions</span>)</span><span class="type-signature"></span></h4>


</dt>
<dd>


<div class="description">
    Unsubscribe for messages, stop receiving messages sent to
    destinations described by the filter.
</div>


<h5>Parameters:</h5>


<table class="params">
    <thead>
    <tr>

        <th>Name</th>


        <th>Type</th>


        <th>Argument</th>


        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>


    <tr>

        <td class="name"><code>filter</code></td>


        <td class="type">


            <span class="param-type">string</span>


        </td>


        <td class="attributes">


        </td>


        <td class="description last">describing the destinations to receive messages
            from.
        </td>
    </tr>


    <tr>

        <td class="name"><code>unsubscribeOptions</code></td>


        <td class="type">


            <span class="param-type">object</span>


        </td>


        <td class="attributes">

            &lt;optional><br>


        </td>


        <td class="description last">used to control the subscription, as
            follows:
            <p>
            <h6>Properties</h6>


            <table class="params">
                <thead>
                <tr>

                    <th>Name</th>


                    <th>Type</th>


                    <th>Argument</th>


                    <th class="last">Description</th>
                </tr>
                </thead>

                <tbody>


                <tr>

                    <td class="name"><code>invocationContext</code></td>


                    <td class="type">


                        <span class="param-type">object</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">passed to the onSuccess callback
                        or onFailure callback.
                    </td>
                </tr>


                <tr>

                    <td class="name"><code>onSuccess</code></td>


                    <td class="type">


                        <span class="param-type">function</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">called when the unsubscribe
                        acknowledgement has been receive dfrom the server. A single
                        response object parameter is passed to the onSuccess callback
                        containing the following fields:
                        <ol>
                            <li>invocationContext if set in the unsubscribeOptions.
                        </ol>
                    </td>
                </tr>


                <tr>

                    <td class="name"><code>onFailure</code></td>


                    <td class="type">


                        <span class="param-type">function</span>


                    </td>


                    <td class="attributes">

                        &lt;optional><br>


                    </td>


                    <td class="description last">called when the unsubscribe request
                        has failed or timed out. A single response object parameter
                        is passed to the onFailure callback containing the following
                        fields:
                        <ol>
                            <li>invocationContext if set in the unsubscribeOptions.
                            <li>errorCode a number indicating the nature of the error.
                            <li>errorMessage text describing the error.
                        </ol>
                    </td>
                </tr>


                </tbody>
            </table>
        </td>
    </tr>


    </tbody>
</table>


<dl class="details">


    <dt class="tag-source">Source:</dt>
    <dd class="tag-source">
        <ul class="dummy">
            <li>
                <a href="mqttCordovaClient.js.html">mqttCordovaClient.js</a>, <a
                    href="mqttCordovaClient.js.html#line1193">line 1193</a>
            </li>
        </ul>
    </dd>


</dl>


<h5>Throws:</h5>


<dl>
    <dt>
    <div class="param-desc">
        if the client is not in connected state and not set Failure callback.
    </div>
    </dt>
    <dt>
    <dl>
        <dt>
            Type
        </dt>
        <dd>

            <span class="param-type">InvalidState</span>


        </dd>
    </dl>
    </dt>
</dl>


</dd>

</dl>


</article>

</section>


</div>

<nav>
    <h2><a href="index.html">Index</a></h2>

    <h3>Classes</h3>
    <ul>
        <li><a href="Messaging.Client.html">Client</a></li>
        <li><a href="Messaging.Message.html">Message</a></li>
    </ul>
    <h3>Namespaces</h3>
    <ul>
        <li><a href="Messaging.html">Messaging</a></li>
    </ul>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Apr 04 2014
    15:56:12 GMT+0900 (China Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"></script>
</body>
</html>